
function TimeFormat(time) {
    let date= new Date(time);
    let year= date.getFullYear();
    let month= date.getMonth()+1;
    month= month<10 ? '0'+month : month;
    let day= date.getDate();
    day= day<10 ? '0'+day : day;
    let hours= date.getHours();
    hours= hours<10 ? '0'+hours : hours;
    let minute= date.getMinutes();
    minute= minute<10 ? '0'+minute : minute;
    let second= date.getSeconds();
    second= second<10 ? '0'+second : second;
    return year + '-' + month + '-' + day + ' ' + hours + ':' + minute + ':' + second;
}

module.exports= {
    TimeFormat
}

